import React from "react";
import CountDown from "@/components/CountDown";

export default function Email()
{
    const [form] = React.UI.Form.useForm();

    const OnSubmit = () =>
    {

    }

    const OnSendEmail = () =>
    {
        console.log(123);
    }

    return (
        <>
            <React.UI.Form
                form={form}
                onFinish={OnSubmit}
                layout="horizontal"
                footer={
                    <React.UI.Button block type="submit" color="primary" size="large">
                        提交
                    </React.UI.Button>
                }
            >
                <React.UI.Form.Item
                    initialValue="123@qq.com"
                    rules={[
                        { required: true, message: "请填写正确的邮箱" },
                        { type: "email", warningOnly: true },
                    ]}
                    name="email"
                    label="邮箱"
                >
                    <React.UI.Input placeholder="请输入邮箱" />
                </React.UI.Form.Item>

                <React.UI.Form.Item
                    label="邮箱验证码"
                    extra={
                        <CountDown
                            initialSeconds={10}
                            buttonTextBefore="发送验证码"
                            SendEmail={OnSendEmail}
                        />
                    }
                    name="code"
                    rules={[{ required: true, message: "验证码不能为空" }]}
                >
                    <React.UI.Input placeholder="请输入邮箱验证码" />
                </React.UI.Form.Item>
            </React.UI.Form>
        </>
    )
}